package com.yuexun.beilunpatient.ui.main.model.impl;

import com.yuexun.beilunpatient.base.BaseEntity;
import com.yuexun.beilunpatient.ui.main.api.MessageUnreadApi;
import com.yuexun.beilunpatient.ui.main.bean.TaskCountData;
import com.yuexun.beilunpatient.ui.main.model.IMessageUnreadModel;
import com.yuexun.beilunpatient.utils.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by chenss on 2018/12/7.
 */
public class MessageUnreadModel implements IMessageUnreadModel {

    private MessageUnreadApi api;


    public MessageUnreadApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(MessageUnreadApi.class);
        }
    }

    @Override
    public Observable<BaseEntity<TaskCountData>> getUnReadSysRemindCount(Map<String, String> praise) {
        api = ApiInstance();
        return api.getUnReadSysRemindCount(praise);
    }
}
